home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / ddj0492.zip / DFLT11.ZIP / XMS.C < prev   
Text File  |  1992-02-03  |  933b  |  49 lines

  1. /* ------------- xms.c --------------- */
  2.  
  3. /*
  4.  * Extended Memory Specification (XMS) Driver Functions
  5.  * This is the resident XMS code.
  6.  */
  7.  
  8. #include "tsr.h"
  9.  
  10. static struct xms_copyparams    {
  11.     long length;
  12.     int src_handle;
  13.     long src_offset;
  14.     int dest_handle;
  15.     long dest_offset;
  16. } xcp;
  17.  
  18. void xms_free(int handle)
  19. {
  20.     _DX = handle;
  21.     _AH = 0x0a;
  22.     (*xmscall)();
  23. }
  24.  
  25. void copy_xmstoconv(int handle, void far *memblk, long offset, long length)
  26. {
  27.     xcp.src_handle = handle;
  28.     xcp.src_offset = offset;
  29.     xcp.dest_handle = 0;
  30.     xcp.dest_offset = (long) memblk;
  31.     xcp.length = length;
  32.     _SI = (unsigned) &xcp;
  33.     _AH = 0x0b;
  34.     (*xmscall)();
  35. }
  36.  
  37. void copy_convtoxms(int handle, void far *memblk, long offset, long length)
  38. {
  39.     xcp.src_handle = 0;
  40.     xcp.src_offset = (long) memblk;
  41.     xcp.dest_handle = handle;
  42.     xcp.dest_offset = offset;
  43.     xcp.length = length;
  44.     _SI = (unsigned) &xcp;
  45.     _AH = 0x0b;
  46.     (*xmscall)();
  47. }
  48.  
  49.